package mythread.demo001;

public class MyThread14_4Test extends Thread {

    public static void main(String[] args) {
        //suspend独占

        try {
            final MyThread14_4 myThread142 = new MyThread14_4();

            Thread thread1 = new Thread() {
                @Override
                public void run() {
                    myThread142.setVal("C","DD");//更新name后暂停，线程不同步
                }
            };
            thread1.setName("a");
            thread1.start();
            Thread.sleep(1000);

            Thread thread2 = new Thread() {
                @Override
                public void run() {
                    myThread142.printSS();
                }
            };
            thread2.start();
            thread2.sleep(1000);

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
